import SelectUtil from '@/SelectUtil';
import AbilityBase from 'code/Scripts/Abilities/base/AbilityBase';
/**
 * 淤泥怪 - 粘性皮肤
 **/
export default class MSK_NianXingPiFu extends AbilityBase {
    static instance: MSK_NianXingPiFu;
    constructor(id: string = 'Mnt0') {
        super(id);
        MSK_NianXingPiFu.instance = this;
        this.init();
        EventManager.onTakeDamage(this.onSpellEffect.bind(this));
    }
    init() {}
    cast<T extends Object = any>(tarX: number, tarY: number, source: unit, target: unit, data?: T): void {}
    onSpellEffect(d: DamageEventData) {
        if (GetUnitAbilityLevel(d.source, this.id) == 0) return;
        if (d.isReflect) return;

        let dmg = d.lastDamage * 0.25;
        d.lastDamage -= dmg;
        let es = SelectUtil.getEnemyUnitsInRange(d.target, 650);
        DamageSystemInstance.applyAoeMagicDamage(es, d.target, dmg, 'poision');
    }
}
